package org.demis.elf;

import java.util.HashMap;
import java.util.Map;

public class DataLine {

    private Table table;

    private Map<Column,Object> values = new HashMap<Column,Object>();

    public Table getTable() {
        return table;
    }

    public void setTable(Table table) {
        this.table = table;
    }

    public void add(Column column, Object value) {
        if (column == null || column.getTable() == null) {
            // TODO : log
        }
        if (table == null) {
            table = column.getTable();
        }
        if (table.getColumns().contains(column)) {
            values.put(column, value);
        }
    }

    public Object getValue(Column column) {
        return values.get(column);
    }
}
